# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

# This file was taken from archlinux community repo after the tool was removed
# Original Maintainer: Felix Yan <felixonmars@archlinux.org>
# Original Maintainer: Daniel M. Capella <polyzen@archlinux.org>
# Original Contributor: Hugo Osvaldo Barrera <hugo@barrera.io>

pkgname=python2-setuptools-scm
_pkgname=setuptools_scm
pkgver=5.0.2
pkgrel=6
pkgdesc='Handles managing your python package versions in scm metadata.'
arch=('any')
url='https://github.com/pypa/setuptools_scm/'
license=('MIT')
depends=('python2-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('1e92d03e2d8473425c146a885eb641e98895c43afebcd3c66c1455ace2d81f187b87681072f8aacc5e8be166577f00138cc7c53e4b7d77cb1b598f835b72b010')

build() {
  cd $_pkgname-$pkgver

  python2 setup.py build
  python2 setup.py egg_info
}

package() {
  cd $_pkgname-$pkgver

  python2 setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build

  install -Dm 644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

